<div id="tag">${insert}</div>
<script type="text/javascript">
var textToInsert = document.getElementById("tag").innerHTML.replace(/\r|\n|\r\n/g, "");
var t1 = '${input}';
if ( t1 !='undefined' ){
			opener.document.forms[0].${input}.value= textToInsert;} 
		else {
			opener.tinyMCE.activeEditor.selection.setContent(textToInsert);
}
self.close();
</script>